#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
struct po{
	int jiahan;
	int jiahua;
	int yihan;
	int yihua;
}p[100];
int main(){
	int nyi=0,mjia=0;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>p[i].jiahan>>p[i].jiahua>>p[i].yihan >>p[i].yihua ;
	}	
	for(int i=0;i<n;i++){	
		if(p[i].jiahan+p[i].yihan==p[i].jiahua && p[i].jiahua!=p[i].yihua){
		nyi++;	
		}else if(p[i].jiahan+p[i].yihan==p[i].yihua && p[i].jiahua!=p[i].yihua)
		mjia++;
}
cout<<mjia<<" "<<nyi;
	return 0;
}
